package demo;

/**
 * @author ZhouWeiBo
 * @create 2022/6/7
 */
public class MoBike extends Bike{
    private String riderName = null;
    private Integer bikeId = null;

    @Override
    protected Integer bikeId() {
        return bikeId;
    }

    public MoBike(Integer bikeId) {
        this.bikeId = bikeId;
    }

    @Override
    public void ride(String riderName) {
        status = 1;
        this.riderName = riderName;
        System.out.println(riderName + "正在使用 " + bikeId + " 号自行车~");
    }

    @Override
    public void back() {
        status = 0;
        System.out.println(this.riderName + "已归还 " + bikeId + " 号自行车！");
    }
}
